package top.lixunda.commerce.common.core.controller.wrapper;

import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;

/**
 * @author LiXunda
 * @version time:2019/10/15 14:19
 */
@SuppressWarnings({"WeakerAccess", "unused"})
public class BaseDataUpdateSqlWrapper<T> extends BaseDataSqlWrapper<T> {

    public BaseDataUpdateSqlWrapper() {
        super.isQuery(false);
    }

    public static <T> BaseDataUpdateSqlWrapper<T> fromWrapper(IAbstractSqlWrapper<T> wrapper) {
        return (BaseDataUpdateSqlWrapper<T>) fromWrapper(wrapper, new BaseDataUpdateSqlWrapper<>());
    }

    @SuppressWarnings("unchecked")
    public UpdateWrapper<T> toUpdateWrapper() {
        return (UpdateWrapper<T>) toMyBatisWrapper(this);
    }

    public static <T> BaseDataUpdateSqlWrapper toDataUpdateSqlWrapper(AbstractSqlWrapper<T> wrapper) {
        return (BaseDataUpdateSqlWrapper<T>) fromWrapper(wrapper, new BaseDataUpdateSqlWrapper<>());
    }

}
